package com.ecoolex.discount.sales.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   折扣订单退款单<br>
 *<br>
 * 数据表： discount_order_refund
 *
 */
@Description({"折扣订单退款单"})
public class DiscountOrderRefund implements Serializable {
    /**
     *
     *   退款Id    <br>
     *<br>
     * 字段名： discount_order_refund.RefundId
     */
    @Description({"退款Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer refundId;

    /**
     *
     *   订单Id    <br>
     *<br>
     * 字段名： discount_order_refund.OrderId
     */
    @Description({"订单Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer orderId;

    /**
     *
     *   退款金额    <br>
     *<br>
     * 字段名： discount_order_refund.Amount
     */
    @Description({"退款金额", "数据长度: 18"})
    private BigDecimal amount;

    /**
     *
     *   退款状态：- pending：等待审核；processing：审核中；refused：拒绝退款请求；refund_success：已成功退款；customer_canceled：用户取消退款申请    <br>
     *<br>
     * 字段名： discount_order_refund.RefundStatus
     */
    @Description({"退款状态：- pending：等待审核；processing：审核中；refused：拒绝退款请求；refund_success：已成功退款；customer_canceled：用户取消退款申请", "不能为空", "数据长度: 20"})
    @NonNull
    private String refundStatus;

    /**
     *
     *   礼卡是否使用过    <br>
     *<br>
     * 字段名： discount_order_refund.CardUsed
     */
    @Description({"礼卡是否使用过", "数据长度: 1"})
    private Boolean cardUsed;

    /**
     *
     *   退款原因    <br>
     *<br>
     * 字段名： discount_order_refund.ReasonType
     */
    @Description({"退款原因", "数据长度: 50"})
    private String reasonType;

    /**
     *
     *   退款原因说明    <br>
     *<br>
     * 字段名： discount_order_refund.ReasonComments
     */
    @Description({"退款原因说明", "数据长度: 1000"})
    private String reasonComments;

    /**
     *
     *   联系方式    <br>
     *<br>
     * 字段名： discount_order_refund.ContactPhone
     */
    @Description({"联系方式", "数据长度: 20"})
    private String contactPhone;

    /**
     *
     *   客服对该退款申请的反馈    <br>
     *<br>
     * 字段名： discount_order_refund.CustomerServiceReply
     */
    @Description({"客服对该退款申请的反馈", "数据长度: 1000"})
    private String customerServiceReply;

    /**
     *
     *   退款申请时间    <br>
     *<br>
     * 字段名： discount_order_refund.ApplyTime
     */
    @Description({"退款申请时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date applyTime;

    /**
     *
     *   审核时间    <br>
     *<br>
     * 字段名： discount_order_refund.AuditTime
     */
    @Description({"审核时间", "数据长度: 26"})
    private Date auditTime;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_order_refund.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_order_refund.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_order_refund.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_order_refund.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_order_refund.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   退款Id    <br>
     *<br>
     * 字段名： discount_order_refund.RefundId
     */
    public Integer getRefundId() {
        return refundId;
    }

    /**
     * 设置参数<br><br>
     *
     *   退款Id<br>
     *<br>
     * 字段名： discount_order_refund.RefundId
     */
    public void setRefundId(Integer refundId) {
        this.refundId = refundId;
    }

    /**
     * 获取参数<br><br>
     *
     *   订单Id    <br>
     *<br>
     * 字段名： discount_order_refund.OrderId
     */
    public Integer getOrderId() {
        return orderId;
    }

    /**
     * 设置参数<br><br>
     *
     *   订单Id<br>
     *<br>
     * 字段名： discount_order_refund.OrderId
     */
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    /**
     * 获取参数<br><br>
     *
     *   退款金额    <br>
     *<br>
     * 字段名： discount_order_refund.Amount
     */
    public BigDecimal getAmount() {
        return amount;
    }

    /**
     * 设置参数<br><br>
     *
     *   退款金额<br>
     *<br>
     * 字段名： discount_order_refund.Amount
     */
    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    /**
     * 获取参数<br><br>
     *
     *   退款状态：- pending：等待审核；processing：审核中；refused：拒绝退款请求；refund_success：已成功退款；customer_canceled：用户取消退款申请    <br>
     *<br>
     * 字段名： discount_order_refund.RefundStatus
     */
    public String getRefundStatus() {
        return refundStatus;
    }

    /**
     * 设置参数<br><br>
     *
     *   退款状态：- pending：等待审核；processing：审核中；refused：拒绝退款请求；refund_success：已成功退款；customer_canceled：用户取消退款申请<br>
     *<br>
     * 字段名： discount_order_refund.RefundStatus
     */
    public void setRefundStatus(String refundStatus) {
        this.refundStatus = refundStatus == null ? null : refundStatus.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   礼卡是否使用过    <br>
     *<br>
     * 字段名： discount_order_refund.CardUsed
     */
    public Boolean getCardUsed() {
        return cardUsed;
    }

    /**
     * 设置参数<br><br>
     *
     *   礼卡是否使用过<br>
     *<br>
     * 字段名： discount_order_refund.CardUsed
     */
    public void setCardUsed(Boolean cardUsed) {
        this.cardUsed = cardUsed;
    }

    /**
     * 获取参数<br><br>
     *
     *   退款原因    <br>
     *<br>
     * 字段名： discount_order_refund.ReasonType
     */
    public String getReasonType() {
        return reasonType;
    }

    /**
     * 设置参数<br><br>
     *
     *   退款原因<br>
     *<br>
     * 字段名： discount_order_refund.ReasonType
     */
    public void setReasonType(String reasonType) {
        this.reasonType = reasonType == null ? null : reasonType.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   退款原因说明    <br>
     *<br>
     * 字段名： discount_order_refund.ReasonComments
     */
    public String getReasonComments() {
        return reasonComments;
    }

    /**
     * 设置参数<br><br>
     *
     *   退款原因说明<br>
     *<br>
     * 字段名： discount_order_refund.ReasonComments
     */
    public void setReasonComments(String reasonComments) {
        this.reasonComments = reasonComments == null ? null : reasonComments.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   联系方式    <br>
     *<br>
     * 字段名： discount_order_refund.ContactPhone
     */
    public String getContactPhone() {
        return contactPhone;
    }

    /**
     * 设置参数<br><br>
     *
     *   联系方式<br>
     *<br>
     * 字段名： discount_order_refund.ContactPhone
     */
    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone == null ? null : contactPhone.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   客服对该退款申请的反馈    <br>
     *<br>
     * 字段名： discount_order_refund.CustomerServiceReply
     */
    public String getCustomerServiceReply() {
        return customerServiceReply;
    }

    /**
     * 设置参数<br><br>
     *
     *   客服对该退款申请的反馈<br>
     *<br>
     * 字段名： discount_order_refund.CustomerServiceReply
     */
    public void setCustomerServiceReply(String customerServiceReply) {
        this.customerServiceReply = customerServiceReply == null ? null : customerServiceReply.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   退款申请时间    <br>
     *<br>
     * 字段名： discount_order_refund.ApplyTime
     */
    public Date getApplyTime() {
        return applyTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   退款申请时间<br>
     *<br>
     * 字段名： discount_order_refund.ApplyTime
     */
    public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   审核时间    <br>
     *<br>
     * 字段名： discount_order_refund.AuditTime
     */
    public Date getAuditTime() {
        return auditTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   审核时间<br>
     *<br>
     * 字段名： discount_order_refund.AuditTime
     */
    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_order_refund.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： discount_order_refund.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_order_refund.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： discount_order_refund.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_order_refund.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： discount_order_refund.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_order_refund.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： discount_order_refund.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_order_refund.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： discount_order_refund.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        refundId("RefundId", "refundId", "INTEGER", false),
        orderId("OrderId", "orderId", "INTEGER", false),
        amount("Amount", "amount", "DECIMAL", false),
        refundStatus("RefundStatus", "refundStatus", "VARCHAR", false),
        cardUsed("CardUsed", "cardUsed", "BIT", false),
        reasonType("ReasonType", "reasonType", "VARCHAR", false),
        reasonComments("ReasonComments", "reasonComments", "VARCHAR", false),
        contactPhone("ContactPhone", "contactPhone", "VARCHAR", false),
        customerServiceReply("CustomerServiceReply", "customerServiceReply", "VARCHAR", false),
        applyTime("ApplyTime", "applyTime", "TIMESTAMP", false),
        auditTime("AuditTime", "auditTime", "TIMESTAMP", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}